<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/index.css"/>
    <script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=OabQI9tXEQtkhwgyuhVSPjUTwdggzA3Y"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
    <link rel="stylesheet" href="https://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css" />
    <php>
        if(!isset($param['height'])){
    </php>
    <script>
        $(function () {
            var height=$(window).height()-94;
            var href="/shop/index/baidu_search/id/{$store_id}/height/"+height+".html";
            location.href=href
        })
    </script>
    <php>}</php>
</head>
<body>
<div id="content1">
    <header>
        <div class="content">
            <a href="/" onclick=""></a>
            <a>店铺导航</a>
            <a href="javascript:;"></a>
        </div>
    </header>
    <div>
        <php>
            if(isset($param['height'])){
        </php>
        <div id="allmap"  style="width: 100%;margin: 0 auto;height:{$param['height']}px"></div>
        <php>}</php>
        <script type="text/javascript">
            // 百度地图API功能
            var map = new BMap.Map('allmap');
            var poi = new BMap.Point("{$store_info.lng}", "{$store_info.lat}"); // 创建点坐标
            map.centerAndZoom(poi, 17);
            map.enableScrollWheelZoom();

            var content =      "<div style='display: block;width:50%;float: left;padding: 10px 0;overflow: hidden;'><img style='float:left;margin:4px' id='imgjingu' src='{:cmf_get_image_preview_url($store_info.more.thumbnail)}'  width='100' /></div>" +
                "<p style='font-size: 12px;line-height: 21px;margin-top: 20px;'>地址：{$store_info.address} </p>";

            //创建检索信息窗口对象
            var searchInfoWindow = null;
            searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, {
                title  : "{$store_info.store_name}",      //标题
                width  : 220,             //宽度
                height : 125,              //高度
                panel  : "panel",         //检索结果面板
                enableAutoPan : true,     //自动平移
                searchTypes   :[
                    BMAPLIB_TAB_SEARCH,   //周边检索
                    BMAPLIB_TAB_TO_HERE,  //到这里去
                    BMAPLIB_TAB_FROM_HERE //从这里出发
                ]
            });
            var marker = new BMap.Marker(poi); //创建marker对象
            marker.enableDragging(); //marker可拖拽
            marker.addEventListener("click", function(e){
                searchInfoWindow.open(marker);
            })
            map.addOverlay(marker); //在地图中添加marker
            //样式1
            var searchInfoWindow1 = new BMapLib.SearchInfoWindow(map, "{$store_info.store_name}", {
                title: "{$store_info.store_name}", //标题
                panel : content , //检索结果面板
                enableAutoPan : true, //自动平移
                searchTypes :[
                    BMAPLIB_TAB_FROM_HERE, //从这里出发
                    BMAPLIB_TAB_SEARCH   //周边检索
                ]
            });
            searchInfoWindow.open(marker);

        </script>

    </div>

</div>

<include file="public@footer"/>
</body>
</html>
